import { Fragment } from 'react';
import { Row } from 'antd';
import { WeaSelect ,WeaLocaleProvider} from 'ecCom';
import defaultData from "./data";
import Props from "../base/Props";
const getLabel = WeaLocaleProvider.getLabel;

const maxFileNumOpts = new Array(15).fill(0).map((v, i) => {
  const key = i + 1;

  return { key, showname: key, selected: 0 === i };
});

export default class PictureProps extends Props {
  renderContent() {
    const {
      restrictions: { maxNum }
    } = this.props.data;

    return (
      <Fragment>
        <Row className='edc-sepline edc-row-hor'>
          <label>{getLabel('502510','最大图片数量')}</label>
          <div>
            <WeaSelect
              value={maxNum}
              style={{ width: '100%' }}
              options={maxFileNumOpts}
              onChange={this.handlePropChange('restrictions.maxNum')}
            />
          </div>
        </Row>
      </Fragment>
    )
  }
}

PictureProps.defaultProps = {
  data: defaultData
};